package com.igeek.base.ch0712.Demo3;

/**
 * @Description TODO
 * @Author chenmin
 * @Date 2024/7/14 13:30
 */
public class Rectangle extends Shape{
    private double weight;
    private double height;

    public Rectangle(double weight, double height) {
        this.weight = weight;
        this.height = height;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    @Override
    public double getArea() {
        return getWeight()*getHeight();
    }

    @Override
    public double getSize() {
        return 2*(getWeight()+getHeight());
    }
    @Override
    public String toString() {
        return "Rectangle{" + "高度=" + getWeight() + ", 宽度=" + getHeight() + '}';
    }
}
